package com.shuma.shopmanage.shopmodule.controller;

import com.shuma.shopmanage.common.result.Result;
import com.shuma.shopmanage.model.shop.vo.CategoryVo;
import com.shuma.shopmanage.shopmodule.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wp
 * @data 2023/10/25
 */
@Api(tags = "商品分类模块")
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Resource
    private CategoryService categoryService;


    @ApiOperation("获取商品分类信息")
    @GetMapping("/info")
    public Result<List<CategoryVo>> info() {
        List<CategoryVo> category = categoryService.getCategory();
        return Result.ok(category);
    }
}
